package com.zym;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;

import java.io.*;
import java.util.Arrays;

public class Test {
    public static void main(String[] args) throws Exception {
//        String extension = FilenameUtils.getExtension("jaskd_kad.png");
//        //FileUtils.copyDirectory(new File("D:\\slkj\\uploadPath\\avatar\\2023\\03\\09"),new File("D:\\slkj\\uploadPath\\avatar\\2023"));
//      //  FileUtils.copyDirectoryToDirectory(new File("D:\\slkj\\uploadPath\\avatar\\2023\\03\\09"),new File("D:\\slkj\\uploadPath\\avatar\\2023"));
//        boolean emptyDirectory = FileUtils.isEmptyDirectory(new File("D:\\slkj\\uploadPath\\avatar\\2023\\03\\09"));
//
//        // FileUtils.isEmptyDirectory()
//        FileInputStream fileInputStream = new FileInputStream("src\\main\\java\\com\\zym\\file\\1.png");
//        FileOutputStream fileOutputStream = new FileOutputStream("src\\main\\java\\com\\zym\\file\\img\\2.png");
//        long l = IOUtils.copyLarge(fileInputStream, fileOutputStream, new byte[1024]);
//        System.out.println(l);
//        IOUtils.closeQuietly(fileInputStream,fileOutputStream);
//        System.out.println(emptyDirectory);
        String[] strings = {
                // 图片
                "bmp", "gif", "jpg", "jpeg", "png",
                // word excel powerpoint
                "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
                // 压缩文件
                "rar", "zip", "gz", "bz2",
                // 视频格式
                "mp4", "avi", "rmvb",
                // pdf
                "pdf"};
//        boolean rmvb = Arrays.stream(strings).anyMatch(s -> s.equals(".rmvb"));
//        System.out.println(rmvb);
        String s="sdhudfh";
        int hu = s.indexOf("hu");
        System.out.println(hu);
        String substring = s.substring(hu+"hu".length());
        System.out.println(substring);
    }

    }
